package com.djakapm.swing.component;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import javax.swing.JFrame;

import com.djakapm.swing.common.ContainerFactory;
import com.djakapm.swing.common.ScreenUtil;


public class SpecForDropdown {
	public static void main(String[] args) {
		Dropdown d = null;
		JFrame frame = ContainerFactory.newFrame(800,100);
		frame.setContentPane(ContainerFactory.newFlowLeadingLayoutedPanel());
		d = new Dropdown();
		frame.getContentPane().add(d);
		Object[] arrayData = {"ArrayItem1","ArrayItem2","ArrayItem3"};
		d = new Dropdown(arrayData);
		frame.getContentPane().add(d);
		List<Object> listData = new ArrayList<Object>();
		listData.add("ListItem1");
		listData.add("ListItem2");
		listData.add("ListItem3");
		d = new Dropdown(listData);
		frame.getContentPane().add(d);
		List<Object> fileListData = new ArrayList<Object>();
		fileListData.add(new File("D:/Djaka/Misc"));
		fileListData.add(new File("D:/Djaka/Misc/Image"));
		fileListData.add(new File("D:/Djaka/Java/Java Programming Ebooks 2008"));
		d = new Dropdown(fileListData);
		frame.getContentPane().add(d);
		d = new Dropdown();
		d.addValue("AddedLaterItem1")
		.addValue("AddedLaterItem2")
		.addValue("AddedLaterItem3");
		
		frame.getContentPane().add(d);
		d.removeValue("AddedLaterItem1")
		.removeValue("AddedLaterItem3");
		System.out.println(d.containsValue("AddedLaterItem2"));
		System.out.println(d.containsValue("AddedLaterItem3"));
		d.clear();
		ScreenUtil.center(frame);
		frame.setVisible(true);
	}
}
